package com.phone580.app.hotgame;

import android.annotation.SuppressLint;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.webkit.WebChromeClient;
import android.webkit.WebView;
import android.widget.ProgressBar;

import com.phone580.app.BaseActivity;
import com.phone580.app.R;

public class HotAppDetailActivity extends BaseActivity {
	private WebView web;
	private ProgressBar pbLoad;
	
	@SuppressLint("SetJavaScriptEnabled")
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.hot_app_detail_layout);
		initOtherHeader();
		Intent intent = getIntent();
		web = (WebView) findViewById(R.id.hot_app_detail_web);
		pbLoad = (ProgressBar) findViewById(R.id.hot_app_detail_load_pb);
		web.getSettings().setJavaScriptEnabled(true);
		web.setWebChromeClient(new WebChromeClient() {
			@Override
			public void onProgressChanged(WebView view, int newProgress) {
				super.onProgressChanged(view, newProgress);
				if (newProgress >= 100) {					
					pbLoad.setVisibility(View.GONE);
				} 
			}
		});
//		web.loadUrl("file:///android_asset/bak2/" + intent.getStringExtra("url"));
		web.loadUrl("file:///mnt/sdcard/bak2/" + intent.getStringExtra("url"));
	}
	
	@Override
	protected void onStart() {
		super.onStart();
		userLogonOrLogout();
	}
}
